<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh">
<head>
    <title>物资出库明细</title>
    <jsp:include page="/WEB-INF/view/commons/css.jsp" />
</head>
<body >
<div id="main-container" class="container-fluid">
    <form  action="appOutDetail/${action eq "create" ?"save":"update"}" name="inputForm" id="inputForm" method="post" class="form-horizontal">
    <input name="id" id="id" value="${entity.id}" type="hidden" />
    <div class="form-group">
        <label class="col-sm-1 control-label">出库单ID：</label>
        <div class="col-md-4">
            <input type="text" class="form-control" name="outBills" value="${entity.outBills}" placeholder="出库单ID">
        </div>
        <label class="col-sm-1 control-label">物资ID：</label>
        <div class="col-md-4">
            <input type="text" class="form-control" name="materialsId" value="${entity.materialsId}" placeholder="物资ID">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-1 control-label">出库状态：</label>
        <div class="col-md-4">
                <d:select name="outStatus" list="${outStatuss}" selected="${entity.outStatus}"/>
        </div>
        <label class="col-sm-1 control-label">出库数量：</label>
        <div class="col-md-4">
            <input type="text" class="form-control" name="outNum" value="${entity.outNum}" placeholder="出库数量">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-1 control-label">备注：</label>
        <div class="col-md-4">
            <input type="text" class="form-control" name="remark" value="${entity.remark}" placeholder="备注">
        </div>
    </div>
    <div class="form-group">
        <div class="col-sm-offset-1 col-sm-2">
            <button id="saveBtn" type="submit" class="btn btn-sm btn-primary"><i class="fa fa-floppy-o"></i> 提交</button>
            <button type="button" class="btn btn-sm link_close"><i class="fa fa-close"></i> 关闭</button>
        </div>
    </div>
    </form>
</div><!--/#main-container-->

<!-- script start -->
<jsp:include page="/WEB-INF/view/commons/js.jsp" />
<script type="text/javascript">
    $(document).ready(function(e) {
        var options = {
            rules:{
                outBills : { required : true, digits : true  },
                materialsId : { required : true, digits : true  },
                outStatus : { required : true },
                outNum : { required : true, digits : true  },
                
            },
            submitHandler:function(form){
                $(form).ajaxSubmit({
                    type:'post',
                    dataType:'json',
                    success:function(data){
                        if(data.success){
                            $('#searchBtn', parent.document).click();
                            closeIframe();
                        }else{
                            layer.alert(data.msg);
                        }
                    }
                });
            }
        };
        $("#inputForm").validate(options);
    });
</script>
<!-- script end -->
</body>
</html>
